package com.ruoyi.common.sql;


public class OrderBy {
    private final String column;
    private final String direction;

    private OrderBy(String column, String direction) {
        this.column = column;
        this.direction = direction;
    }

    public static OrderBy asc(String column) {
        return new OrderBy(column, "ASC");
    }

    public static OrderBy desc(String column) {
        return new OrderBy(column, "DESC");
    }

    public void build(StringBuilder sql) {
        sql.append(column).append(" ").append(direction);
    }
}